
import { apiA } from '../utils/request'


export const login = (data) => {
    return apiA.post('api/auth/login', data)
}

export const register = (data) => {
    return apiA.post('api/auth/register', data)
}

export const uploadFile = (data) => {
    return apiA.post('api/file/upload', data, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

export const downloadFile = (fileId) => {
    return apiA.get(`api/file/download/${fileId}`, {
        responseType: 'blob'
    });
};